package com.seezoon.admin.modules.${moduleName}.service.impl;

<#list columnPlans as columnPlan>
  <#if columnPlan.uniqueFieldCheck && columnPlan.stringType>
import javax.validation.constraints.NotBlank;
    <#break>
  </#if>
</#list>
<#list columnPlans as columnPlan>
  <#if columnPlan.uniqueFieldCheck && !columnPlan.stringType>
import javax.validation.constraints.NotNull;
    <#break>
  </#if>
</#list>
import com.seezoon.admin.framework.service.impl.BaseServiceImpl;
import com.seezoon.admin.modules.${moduleName}.service.I${className}Service;
import com.seezoon.dao.modules.${moduleName}.${className}Mapper;
import com.seezoon.dao.modules.${moduleName}.entity.${className};
import org.springframework.stereotype.Service;
<#list columnPlans as columnPlan>
  <#if columnPlan.uniqueFieldCheck>
import com.seezoon.dao.modules.${moduleName}.condition.${className}Condition;
import org.springframework.transaction.annotation.Transactional;

    <#break>
  </#if>
</#list>

/**
 * ${menuName!}
 *
 * @author seezoon-generator
 * @since ${.now}
 */
@Service
public class ${className}ServiceImpl extends BaseServiceImpl<${className}Mapper, ${className}> implements I${className}Service {
    <#list columnPlans as columnPlan>
      <#if columnPlan.uniqueFieldCheck>

    @Transactional(readOnly = true)
    public ${className} findBy${columnPlan.javaFieldName?cap_first}(${columnPlan.stringType?string("@NotBlank","@NotNull")} ${columnPlan.dataType.javaType()} ${columnPlan.javaFieldName}) {
        ${className}Condition ${className?uncap_first}Condition = new ${className}Condition();
        ${className?uncap_first}Condition.set${columnPlan.javaFieldName?cap_first}(${columnPlan.javaFieldName});
        return this.findOne(${className?uncap_first}Condition);
    }
      </#if>
    </#list>
}
